package com.example.template.conroller;

import com.example.template.model.User;
import com.example.template.service.UserService;
import com.example.template.utils.ObjectHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ Author     ：jujh
 * @ Date       ：Created in 15:06 2018/12/5
 * @ Description：用户
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/findAllUser")
    @ResponseBody
    public String findAllUser() {
        List<User> userList = userService.findAllUser();
        return ObjectHelper.objectToJson(userList);
    }
}
